package com.example;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;

/**
 * Created by Administrator on 2018/5/15.
 */

public class SecondActivity extends AppCompatActivity implements View.OnClickListener {

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.menu);
        initView();
    }

    private void initView() {
        Button but1 = findViewById(R.id.bt_deal);
        but1.setOnClickListener(this);
        Button but2 = findViewById(R.id.bt_phone);
        but2.setOnClickListener(this);
        Button but3 = findViewById(R.id.bt_picture);
        but3.setOnClickListener(this);
        Button but4 = findViewById(R.id.bt_weather);
        but4.setOnClickListener(this);
        Button but5 = findViewById(R.id.bt_music);
        but5.setOnClickListener(this);
        Button but6 = findViewById(R.id.bt_movie);
        but6.setOnClickListener(this);
    }

    @Override
    public void onClick(View view) {
        int id = view.getId();
        switch (id) {
            case R.id.bt_deal:
                Intent intent = new Intent(this, dealActivity.class);
                startActivity(intent);
                break;
            case R.id.bt_phone:
                Intent intent1 = new Intent(this, PhoneActivity.class);
                startActivity(intent1);
                break;
            case R.id.bt_picture:
                Toast.makeText(this, "即将跳转到图库", Toast.LENGTH_SHORT).show();
                Intent intent2 =new Intent(this,PictureActivity.class);
                startActivity(intent2);
                break;
            case R.id.bt_weather:
                Toast.makeText(this, "功能暂未开放", Toast.LENGTH_SHORT).show();
                break;
            case R.id.bt_music:
                Toast.makeText(this, "功能暂未开放", Toast.LENGTH_SHORT).show();
                break;
            case R.id.bt_movie:
                Toast.makeText(this, "功能暂未开放", Toast.LENGTH_SHORT).show();
                break;
        }
    }
}
